﻿using Dapper;
using StudentWeb.IDAL;
using StudentWeb.Model;
using StudentWeb.Common;
using System.Collections.Generic;
using System.Data;
using System.Linq;

namespace StudentWeb.DAL
{
    /// <summary>
    /// XhUserData的数据操作类
    /// </summary>
    public partial class XhUserDataDAO : IXhUserDataDAO
    {
        #region 获取单条记录 通过XhUserName
        /// <summary>
		/// 获取单条记录 通过UserMobile
		/// </summary>
		/// <param name="mobile">mobile</param>
		/// <returns>实体</returns>
        public XhUserData GetInfoByUserName(string XhUserName)
        {
            var sql = "SELECT * FROM XhUserData WHERE XhUserName = @XhUserName";
            using (var conn = ConnectionFactory.CreateConnection())
            {
                var model = conn.QueryFirstOrDefault<XhUserData>(sql, new { XhUserName = XhUserName });
                return model;
            }
        }
        #endregion
    }
}

